<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-10-21 16:18:14
 * @LastEditors: charles
 * @LastEditTime: 2021-10-21 16:35:47
-->
<template>
  <div class="orders">
    <div>我的</div>
    <van-button type="primary" size="small" @click="logoutHandler">退出</van-button>
  </div>
</template>
<script>
import {useRouter} from 'vue-router'
export default {
  setup() {
    let router = useRouter();

    let logoutHandler = ()=>{
      localStorage.removeItem('token');
      router.push('/login');  
    }

    return {
      logoutHandler
    }
  },
}
</script>